package myorg.myrpc.thrift;

import myorg.myrpc.IMyrpc;
import myorg.myrpc.IMyrpcDecorator;

public class IMyrpcClient extends IMyrpcDecorator {
	public final ClientExtendTools clientTools;
	public IMyrpcClient(IMyrpc delegate) {
		super(delegate);
		clientTools = new ClientExtendTools(delegate);
	}
    /**
     * @param host RPC service host
     * @param port RPC service port 
     */
    public IMyrpcClient(String host,int port) {
        this(new IMyrpcThriftClient(host,port));
    }
    /**
     * test if connectable for RPC service
     * @return return {@code true} if connectable ,otherwise {@code false}
     */
    public boolean testConnect(){
        return clientTools.getFactory().testConnect();
    }
}
